From: Joey Hess Date: Thu, 30 Jan 2025 19:07:17 +0000 (-0400) Subject: Merge branch 'master' into ospath X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~6^2~158^2~51 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a03c6092688ea3953914fc1e0b84678bd56e3a37;p=git-annex.git Merge branch 'master' into ospath --- a03c6092688ea3953914fc1e0b84678bd56e3a37 diff --cc doc/todo/RawFilePath_conversion.mdwn index 3676495fd6,46c9bc3bbe..8cd441d50f --- a/doc/todo/RawFilePath_conversion.mdwn +++ b/doc/todo/RawFilePath_conversion.mdwn @@@ -17,27 -17,8 +17,18 @@@ status replacing all the RawFilePath with OsPath, which should be pretty mechanical, with only some wrapper functions in Utility.FileIO and Utility.RawFilePath needing to be changed. - * Utility.FileIO is used for most withFile and openFile, but not yet for - readFile, writeFile, and appendFile on FilePaths. - Note that the FilePath versions do newline translation on windows, - which has to be handled when converting to the Utility.FileIO ones. - * System.Directory.OsPath is available with OsPath build flag, but - not yet used, and would eliminate a lot of fromRawFilePaths. - Make Utility.SystemDirectory import it when built with OsPath, - and the remaining 6 hours or work will explain itself.. - This has been started in the `ospath` branch. - - Work on this is underway, in the `ospath` branch. +* As part of the OsPath conversion, Git.LsFiles has several + `pipeNullSplit'` calls that have toOsPath mapped over the results. + That adds an additional copy, so the lazy ByteString is converted to strict, + and then to ShortByteString, with a copy each time. This is in the + critical path for large git repos, and might be a noticable slowdown. + There is currently no easy way to go direct from a lazy ByteString to a + ShortByteString, although it would certianly be possible to write low + level code to do it efficiently. Alternatively, it would be possible to + read a strict ByteString direct from a handle, like hGetLine does + (although in this case it would need to stop at the terminating 0 byte) + and unsafePerformIO to stream to a list would avoid needing to rewrite + this code to not use a list. [[!tag confirmed]]